package com.itcast.demoone.kotlin

fun main() {
//    demo1()
//    println(sum(1, 2))
//    println(sum1(1, 1000))
//    println(sum2(1, 10001))
    printAll("hello", "world", "kotlin", "java", "android")
}

fun demo1() {
    println("hello world")
}

fun sum(num1: Int, num2: Int): Int {
    return num1 + num2
}

fun sum1(num1: Int, num2: Int = 100): Int {
    return num1 + num2
}

fun sum2(num1: Int, num2: Int): Int = num1 + num2

// 可变参数
fun printAll(vararg msg: String){
    for (m in msg){
        println(m)
    }
}